/*
 * BorderStage.fx
 *
 * Created on 16-may-2009, 18:05:02
 */

package webooksfx_desktop.view;

import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.ShapeIntersect;
import webooksfx_desktop.view.components.ButtonImage;
import webooksfx_desktop.view.components.effects.effect_Glow_BlackAndWithe;

/**
 * @author Administrador
 */
public class BorderStage extends CustomNode {
	public var width : Integer = 0;
	public var height : Integer = 0;
	public var actionClose : function() : Void;
	public var offsetY : Integer = 30;

	public override function create(): Node {
		return Group {
			content: [
				ShapeIntersect {
					a:	Rectangle {
							width: width
							height: offsetY
						}
					b:	Rectangle{
						width: width
						height: offsetY + 30
						arcHeight: 30
						arcWidth: 28
						fill: Color.BLUE
					}
				},effect_Glow_BlackAndWithe{
					translateX: bind width - offsetY - 5;
					nodo: ButtonImage{
						translateY: 2
						width: offsetY - 4
						image: "{__DIR__}images/boton_close.png"
						action: actionClose
					}
				}
			]
		};
	}
}